#include<stdio.h>

int main()
{
    char s1[100], s2[100];
    fgets(s1, 100, stdin);
    fgets(s2, 100, stdin);
    int len = strlen(s1);
    s1[len - 1] = s2[len - 1] = '\0';
    len--;
    int cnt = 0;
    for (int i = 0; s1[i] != '\0'; i++)
        if (s1[i] == s2[i])    cnt++;
    printf("%.1lf%%", cnt * 100.0 / len);
    return 0;
}